﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using IfSoft.OA.Entities;
using IfSoft.OA.DataAccess;

namespace IfSoft.OA.Business
{
    public class BankBillManager : IBankBillManager
    {
        #region Private Members

        private IBankBillRepository _repository;

        #endregion

        #region Constrcutor

        public BankBillManager()
            : this(null)
        {
        }

        public BankBillManager(IBankBillRepository repository)
        {
            if (repository == null)
                _repository = new BankBillRepository();
            else
                _repository = repository;
        }

        #endregion

        #region Basic CRUD operations

        public void Create(BankBill bo)
        {
            _repository.Create(bo);
        }

        public void Update(BankBill bo)
        {
            _repository.Update(bo);
        }

        public void Delete(int id)
        {
            _repository.Delete(id);
        }

        public BankBill SearchById(int id)
        {
            return _repository.SearchById(id);
        }

        public List<BankBill> Search(BankBillCriteria criteria)
        {
            return _repository.Search(criteria);
        }

        public PagedList<BankBill> SearchPagedList(BankBillCriteria criteria)
        {
            return _repository.SearchPagedList(criteria);
        }

        #endregion
      
    }
}
